public class Test {
    public static void main(String[] args) {
        String name="name=zhangsan&age=20";
        String[] ch=name.split("&");//按&拆分
        for (String s: ch) {
            String[] ss=s.split("=");
            for (String s1: ss) {
                System.out.println(s1);
            }
        }
    }
}
